{{ if ($beginopen) }}
<div id="dialogsearpanel">
<form name = "fmseam">
<table style ="width:100%" class="tableA">
<tr>
<th>店舗</th>
<td>
<input type="text" name="name" value="{{ $nameval }}" class="text" />&nbsp;
</td>
</tr>
<tr>
<th>AJA名</th>
<td>{{ html_radios  name='sort' class="sort" options=$sorts selected=$forms.sort separator='&nbsp;' }}
<span id="tr_op2"  style="display:{{if ($forms.sort == 2) }}block{{ else }}none{{ /if}};">
{{ html_options id="area_cd" name='area_cd' options=$areauser selected=$forms.area_cd }}{{ $err.area_cd }}</span> 
<span id="tr_op3"  style="display:{{if ($forms.sort == 3) }}block{{ else }}none{{ /if}};">
{{ html_options id='zone_cd' name='zone_cd'  options=$zoneuser selected=$forms.zone_cd }}{{ $err.zone_cd }}</span> 
 </td></tr>
</table>
<div class="alignCenter">
	<button type="button" class="btn_filtermuti" id="idbtn_filtermuti"  >検索</button>
</div>
</form>
<div id = "diologlistmuti_dnpwp">
{{ /if }}
	<div id="serach_result_muti" class="serach_result">
		<table style="width:100%">
		{{ if $forms.del == '1'}} 
			{{ foreach from=$data key=k item=v name="member" }}
			<tr class="selmuti"><td><a href="javascript:delShopTd('{{ $v.shop_cd }}')" style="color:blue">{{ $v.shop_cd }}&nbsp;&nbsp;{{ $v.shop_name }}</a></td>
			<td>{{ $v.local_name }}<input type="hidden" name="shop_cd_ul[]" value="{{ $v.shop_cd }}" /></td></tr>
			{{ /foreach }}
		{{else}}
			{{ foreach from=$data key=k item=v name="member" }}
			<tr class="selmuti"><td><a href="javascript:addShopTd('{{ $v.shop_cd }}')" style="color:blue">{{ $v.shop_cd }}&nbsp;&nbsp;{{ $v.shop_name }}</a></td>
			<td>{{ $v.local_name }}<input type="hidden" name="shop_cd_ul[]" value="{{ $v.shop_cd }}" /></td></tr>
			{{ /foreach }}
		{{/if}}
		</table>
	<script type="text/javascript">
	var searchData = new Array();
	{{ foreach from=$data key=k item=v name="member" }}
		searchData["{{$v.shop_cd }}"] = new seachObj('{{ $v.area }}','{{ $v.zone }}','{{ $v.shop_cd }}','{{ $v.shop_name }}','{{ $v.year_sale }}','{{$v.shop_nums}}','{{$v.ins_count}}');
	{{ /foreach }}
	</script>
	</div>
{{ if ($beginopen) }}
</div>

<script type="text/javascript">
	$('.btn_filtermuti').click(function(){
		gMutiObj = "shop";
		var thesort = $('input:radio[name="sort"]:checked').val() ;
		var urlPara = makeURL( gMutiObj, document.fmseam.name.value, "mserach_muti_dnpwp_shop.php");
		urlPara = urlPara + "&sear=1"
		urlPara = urlPara + "&w={{$forms.w}}&p={{$forms.p}}";
		
		if  (thesort == "2"){
			var area =  $("#area_cd").val()
			urlPara = urlPara + "&sort=2&ar=" + area ;
		}
		if  (thesort == "3"){
			var zone =  $("#zone_cd").val()
			
			urlPara = urlPara + "&sort=3&zo=" + zone;
		}
		
		{{ if $forms.del == '1'}} 
			urlPara = urlPara + "&del={{$forms.del}}";
		{{/if}}
	//	window.open(urlPara);
		$("#serach_result_muti").load(urlPara);
	});
	
	$('.sort').change(function(){
		if (this.value == 2) {
			$('#tr_op3')['hide']();
			$('#tr_op2')['show']();
		}else if (this.value == 3) {
			$('#tr_op2')['hide']();
			$('#tr_op3')['show']();
		}else {
			$('#tr_op2')['hide']();
			$('#tr_op3')['hide']();
		}
	});
	
	
	$('input').keypress(function(ev) {
		if ((ev.which && ev.which === 13) || (ev.keyCode && ev.keyCode === 13)) {
			$("#idbtn_filtermuti").trigger("click") 
			return false;
		} else {
			return true;
		}
	});
	
	function li_addm(inID, inVal) {
		li_add("pop",inID, inVal);
	}
	
	function li_adds(inArea,inZone,inID, inVal, inSale,inIns) {
		li_add("pop",inID, inVal, inSale);
		$('#dialog').dialog("close");
	}
	document.fmseam.name.focus();
</script>
{{ /if }}

	